package org.frame.myaop;

public class ChainManager implements IAddFeatureChain{
    private  InterceptorChain chain;
    private Object target;

    public ChainManager() {
    }

    public ChainManager(Object target) {
        chain = new InterceptorChain();
        this.target = target;
    }

    public Object getTarget() {
        return target;
    }

    public void setTarget(Object target) {
        this.target = target;
    }

    public ChainManager addBefore(Inteceptor e){
        chain.addBefore(e);
        return this;
    }
    public ChainManager addAfter(Inteceptor e){
        chain.addAfter(e);
        return this;
    }
    public void beforeExecute(){
        chain.beforeExecute();
    }
    public void afterExecute(){
        chain.afterExecute();
    }

}
